UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v5GlmaOwk4z6KSUNDEbbnGJ+rkfszaTlUqmvvf6XfF8=' 
WHERE 
  key_id = 'afc7ae28e2dc08a1464768b3d862a09ad1a3a11fdd0bb3be4bf5fb26b23766e3' 
  AND (
    token = 'v5GlmaOwk4z6KSUNDEbbnGJ+rkfszaTlUqmvvf6XfF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025