UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eDPfq53hgsQGc+LtQyBks+9uma6/dtWI4fI5XQ4FyO8='
WHERE
key_id = 'ae4d6edac638ac7095cb2c36dd1ddc78faffb242fb552ed63f893451270b4d93'
AND (
token = 'eDPfq53hgsQGc+LtQyBks+9uma6/dtWI4fI5XQ4FyO8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)