UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'svPLMBZ4IRmp5CpWh5ZlY+f2blA+HlQ9ijqlgPQazjk=' 
WHERE 
  key_id = '4ba64398e694af9e29eaf674e01f66d76468b5209e8c2b348a893e88566269c0' 
  AND (
    token = 'svPLMBZ4IRmp5CpWh5ZlY+f2blA+HlQ9ijqlgPQazjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038