UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sz7zDqBWAqSLtt9rWVEFelLourpkFrwqZv/Ea7mSJFc=' 
WHERE 
  key_id = 'd0dbf340a2feebab8623a559aa3035b5d1019c4f1d05dc1423856a82491d864a' 
  AND (
    token = 'Sz7zDqBWAqSLtt9rWVEFelLourpkFrwqZv/Ea7mSJFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034