UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rphhp9F6g34ydHcfh3iLHW/e7onmJynE2wZX+2GhzuM='
WHERE
key_id = '639fff0395d1032958dad713ebef8290494eb541aa967f74331025d648b57ade'
AND (
token = 'Rphhp9F6g34ydHcfh3iLHW/e7onmJynE2wZX+2GhzuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)