UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H4GEHUOsUoBb2daDct3OCQwctr/NAASqeVXbA82Jkto='
WHERE
key_id = '41ff1554ea018648b82ae6588ff873de8cb38c6481f2d8b3d772198fccda31a0'
AND (
token = 'H4GEHUOsUoBb2daDct3OCQwctr/NAASqeVXbA82Jkto='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)