UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oIqgr3JzIqe+qgGVs03shAJqX3r59Rmrwe53I6mDFJw=' 
WHERE 
  key_id = '367c5d9baa367c63d046cb4cb0ced4c342eaf5c59a01f747eb69fde9368cd41d' 
  AND (
    token = 'oIqgr3JzIqe+qgGVs03shAJqX3r59Rmrwe53I6mDFJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036