UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E8WwpS0qyaii2dBU6DZqblc7kYmw9DuwgIpbgyQeUYA='
WHERE
key_id = 'ef57e0ac84b2f2d48f5e20f7569bb68bf39b5a79c0bea94b56510830d77dff8c'
AND (
token = 'E8WwpS0qyaii2dBU6DZqblc7kYmw9DuwgIpbgyQeUYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)