UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z8I4Xj/gnBUxRMkwL4Wqi3FsMcQVTGeoDB5EmrfmJfk='
WHERE
key_id = '19fe0cd2db3be3827c915740d8cbb1cf2397189f42d5beae80703928f933b457'
AND (
token = 'Z8I4Xj/gnBUxRMkwL4Wqi3FsMcQVTGeoDB5EmrfmJfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)