UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rfHu9BaOlwx83I0WForEfe3cu8Iady8b2XZoqPa+iko='
WHERE
key_id = 'dfde447a2dc6e62a62ec622279392e4e6bae068f23eca6c2f1d1c7ff9d5eac28'
AND (
token = 'rfHu9BaOlwx83I0WForEfe3cu8Iady8b2XZoqPa+iko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)