UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e5EBG6/TOSN5+7yw4t/tFWkdqZjK7QRrwzfh25+Fgxk='
WHERE
key_id = '5c930a25da104401f206fefb397f557a2372ac69543dc3cb0cf7c834c202a512'
AND (
token = 'e5EBG6/TOSN5+7yw4t/tFWkdqZjK7QRrwzfh25+Fgxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)