UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/o2qW+dtNGMPzVg1R3GzoPMoFIqejDGIWErPZUmqL24=' 
WHERE 
  key_id = '7709deeedd49ac59a1984705265b0045246cbd31da37f3c2295a702bb0a3d0d0' 
  AND (
    token = '/o2qW+dtNGMPzVg1R3GzoPMoFIqejDGIWErPZUmqL24=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026