UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EHHM08sqHBZPkAq5vwXq63FvPpn3MJ2ZshpUnZ8oty8='
WHERE
key_id = '23d132f6cd6d913d25a744049b7f2834c14efa4f5337a187b5beed305553b727'
AND (
token = 'EHHM08sqHBZPkAq5vwXq63FvPpn3MJ2ZshpUnZ8oty8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)