UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'atVu4Dmv/wjavh/Z5NoOEPK01EXjaqwN/NadieXeYQ8=' 
WHERE 
  key_id = 'e1bd5ae9f778f4a03e55622f6094f485ec7ff0e516f09065d960b3a421830720' 
  AND (
    token = 'atVu4Dmv/wjavh/Z5NoOEPK01EXjaqwN/NadieXeYQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018