UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UZu1UFVdZS5hdHtFhBWby1ziVVOCyqAMAW5FuY2iUPU='
WHERE
key_id = '45fa72e60fd185231a84929556ca6ec0a134eb7f7156fa5e8529f20cab8582e4'
AND (
token = 'UZu1UFVdZS5hdHtFhBWby1ziVVOCyqAMAW5FuY2iUPU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)