UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XWkqknJidfUKwBNtYst4yq4Z+5NmxgUcuXpjE97fsME=' 
WHERE 
  key_id = 'ca67320aff5260b4918e9c3fdfcd3a8e1c2891b88ce974350693a863aaca06f9' 
  AND (
    token = 'XWkqknJidfUKwBNtYst4yq4Z+5NmxgUcuXpjE97fsME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017