UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm88gDmrCrJR+affz5EXfTbq/BzH8yyI8ZyClMmta2bA=' 
WHERE 
  key_id = '56295fe714a6e7f6601968e3c1572424b56b991e0a61e7db0d621a9bfcb85aa3' 
  AND (
    token = 'm88gDmrCrJR+affz5EXfTbq/BzH8yyI8ZyClMmta2bA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040