UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i5rmdpa5vxwkB9zoXNNVxtWM8BCpmEiyN7cULDl4c4E='
WHERE
key_id = '155f7658c56d2dfa3ddfed9a4301188213e77227c73244ebdff52b0f902f0b16'
AND (
token = 'i5rmdpa5vxwkB9zoXNNVxtWM8BCpmEiyN7cULDl4c4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)