UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AwLKMUoZsTWS5ISzFFSWqFcWlT+1WJl2Bqfz+kKQUU8=' 
WHERE 
  key_id = 'c9b00fd62e2c7d969b8ba75a6e7b0e9ad31b44e7dc61d603ac074b342acce8f2' 
  AND (
    token = 'AwLKMUoZsTWS5ISzFFSWqFcWlT+1WJl2Bqfz+kKQUU8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029