UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Ab/0DNCyUudrH2MzGN8qhg6EJDPowP8lUR243F9B1E='
WHERE
key_id = '518ba0d182b900cde8bf97701e5b6a6db8f2a5223acdd8e8716913b1d2b79694'
AND (
token = '4Ab/0DNCyUudrH2MzGN8qhg6EJDPowP8lUR243F9B1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)