UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YzgUR+9VLwpxL1bmShqziLYgGcii/hcXgjLD9uqIwc0=' 
WHERE 
  key_id = '897600a1a1dc82b27cc1e0db7f5b50cbbcf9ee818def1ce939976f69fd3eee56' 
  AND (
    token = 'YzgUR+9VLwpxL1bmShqziLYgGcii/hcXgjLD9uqIwc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041