UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HdeJsAPOjemlymgiQ0MNkN5/nM4G3fZJZWKFwu4WZY8=' 
WHERE 
  key_id = 'c4d024296c22f49073f6d14271afc85dc222b094dff8c013620336dfe31024e0' 
  AND (
    token = 'HdeJsAPOjemlymgiQ0MNkN5/nM4G3fZJZWKFwu4WZY8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026