UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wMm5rc1bWFnv6nbkPqKulxkljGMHvjuTj4Q0FMVsEPY='
WHERE
key_id = '2738343be7f45e2ce666886e4145d11f9980c4e0d812b49d1fb7393e5a3e252d'
AND (
token = 'wMm5rc1bWFnv6nbkPqKulxkljGMHvjuTj4Q0FMVsEPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)