UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sMlyL5WblVC7gKMRo2g+gUzHmqYuiuuqUPQea7m7CXE='
WHERE
key_id = '11fab990d747d8bfa8ab42cd25cd9856dab3891eafe964806c37e59282a1e85a'
AND (
token = 'sMlyL5WblVC7gKMRo2g+gUzHmqYuiuuqUPQea7m7CXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)