UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EO3dWc+6kA4BGTBNVD/+s8lr1mOgevmKm2/Nyo3GWQE='
WHERE
key_id = '6222748cc7a33ae9be8de86c6227a6d6ab996bf6faeaee9f6b0cf6389dc423a4'
AND (
token = 'EO3dWc+6kA4BGTBNVD/+s8lr1mOgevmKm2/Nyo3GWQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)