UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y3XCG5WAlQzUGxnnwOTH1nPo5KbU5f3KRMH3dtiaOz4=' 
WHERE 
  key_id = '143bc26ff09d2b99cb0bbc6607e37f491b87765e9f44bead6c5a0b9ec880d436' 
  AND (
    token = 'y3XCG5WAlQzUGxnnwOTH1nPo5KbU5f3KRMH3dtiaOz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024