UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'urE8bFw/eHJ16fr/+r/L7uXTJi6wywC/z/wffmRMJsI='
WHERE
key_id = '89179c907b001f5818d90d7e350acff27b38df5fdd2d41927f673949ebb8c221'
AND (
token = 'urE8bFw/eHJ16fr/+r/L7uXTJi6wywC/z/wffmRMJsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)