UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FasNNwIHvwWgCqIR+sAQj9Nv/5LGJVSofiQmjzNVty4=' 
WHERE 
  key_id = 'ababb938bc65476dbda7ae960507afeee0a974e51ba4c43d64a2367defc2450b' 
  AND (
    token = 'FasNNwIHvwWgCqIR+sAQj9Nv/5LGJVSofiQmjzNVty4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041