UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SzlwEUdZVhyfpDUC1OV/A7R+iYNgwXoVpVAudMXyVP8='
WHERE
key_id = 'b74d44907d511a1588a792ad412a814635a4e263ed361f5970d62d5be7e6a680'
AND (
token = 'SzlwEUdZVhyfpDUC1OV/A7R+iYNgwXoVpVAudMXyVP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)