UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '24QFCTYfivXeHt9LNKoD/OBWiYWCs3lW6HgbT34CsMM=' 
WHERE 
  key_id = '6ce1ce5e5ac5fa02019f676701a1969fee95ecf37f3e507eb9798b8579e49f16' 
  AND (
    token = '24QFCTYfivXeHt9LNKoD/OBWiYWCs3lW6HgbT34CsMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026