UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BuIwSnoVptjfBTZ5mEXFKffAvKuFJy7T+bf7LoH47Qw=' 
WHERE 
  key_id = 'f7ac1811f668f71eb5fc87bd8eadc243f16199cf06dccdc02b9d9c32a813d9a3' 
  AND (
    token = 'BuIwSnoVptjfBTZ5mEXFKffAvKuFJy7T+bf7LoH47Qw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031