UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yooOoe/rdfWj9seKimK/6RdQ+Hyra3hzMCkJrba/VVE=' 
WHERE 
  key_id = '4c729df092ef8013941e2dddd8a3d3b1b40174f3f1361f5e538d2252288ecb94' 
  AND (
    token = 'yooOoe/rdfWj9seKimK/6RdQ+Hyra3hzMCkJrba/VVE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050