UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M2gucTCjWZbDjO5cOtUhXzyHb4Z0RGXBY+TvsTJGhEc='
WHERE
key_id = '7edb1ed3bc690957b0f872b25412167687bb6edbbe8341d8e85c841527c5a855'
AND (
token = 'M2gucTCjWZbDjO5cOtUhXzyHb4Z0RGXBY+TvsTJGhEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)