UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gJOgdwH2n6ttJAXRtC9sieKL3mNEs3TJ+aDbX/sSmJU=' 
WHERE 
  key_id = 'e42761b2ce4b30e5bb1701d09eb5c5bb9069c4a5352c547b649c34d7e26dce00' 
  AND (
    token = 'gJOgdwH2n6ttJAXRtC9sieKL3mNEs3TJ+aDbX/sSmJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029