UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GD2Hv0S5MfHB1tQ4+4qnvGcfUQULdsl+XBhpGjT6cTE=' 
WHERE 
  key_id = '629d7c27c5e00a1f5fb72a6e51dac8f787bdc6886823980cb7683715260e854e' 
  AND (
    token = 'GD2Hv0S5MfHB1tQ4+4qnvGcfUQULdsl+XBhpGjT6cTE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018