UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hmq2zvGR2QrvypdczQ6sr/ccLqpWKPI7muiH6xBtnSI=' 
WHERE 
  key_id = 'f0849e9e072b440c224c271ec08da044ef0a5e0025684265237ee62b4a026ae7' 
  AND (
    token = 'Hmq2zvGR2QrvypdczQ6sr/ccLqpWKPI7muiH6xBtnSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030