UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EIRT9t41r++r+WI0g1jjGSGq0jd4yY65r6S5iqssAHA=' 
WHERE 
  key_id = '01b5eded9233d728dbaa76acfc0ad427f6a66d7380f9ef549e5f5c2c0f31a46d' 
  AND (
    token = 'EIRT9t41r++r+WI0g1jjGSGq0jd4yY65r6S5iqssAHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024