UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p3QSW0ZgEPPKd6rHAazwX9QQ5clN3Lv3TsI5GFms8Vs=' 
WHERE 
  key_id = '891c3977378ef7c634e39962403e3485ccf3a42c53ea8224406d3f1004f58b49' 
  AND (
    token = 'p3QSW0ZgEPPKd6rHAazwX9QQ5clN3Lv3TsI5GFms8Vs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027