UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ghwmNuyTeYA6uiZkaGUZAAaAcOKfgODRyRExQSDh2BU='
WHERE
key_id = '920d892ead2fcbb1afefcb5f1185fcfbae5e85201a445a162c26ab5fa8c8d996'
AND (
token = 'ghwmNuyTeYA6uiZkaGUZAAaAcOKfgODRyRExQSDh2BU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)