UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jeJTZ9g8D2s52tSYWADo/E9uW9MMFEWR/q7LDCDx0SY=' 
WHERE 
  key_id = 'e15d23e156d25955953243f7396827937df4b2286c425312bcfc31b1f9a8daac' 
  AND (
    token = 'jeJTZ9g8D2s52tSYWADo/E9uW9MMFEWR/q7LDCDx0SY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025