UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6SvBwgdiLYrpTr8XSirCdxnbPgS4wM+pyFLSPsgyv2o='
WHERE
key_id = '036338e31436eba52c16a248c62d634767c733f96d05714a3c7ab6b9fd495862'
AND (
token = '6SvBwgdiLYrpTr8XSirCdxnbPgS4wM+pyFLSPsgyv2o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)