UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PcUTAjVcX/73Cxfnllg6FswzuNYkmyjGU47siR6snR8='
WHERE
key_id = '65d4d9409cfa6f52a488a34848cd4aff89db934e06f657dc59fdf89c6b45b900'
AND (
token = 'PcUTAjVcX/73Cxfnllg6FswzuNYkmyjGU47siR6snR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)