UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/A3wX14Nn3Ls0wJy+pxvDHB5XFYbB07xYZRLlLksEKw='
WHERE
key_id = 'dbc074fe7d48100423b0bf6d66d891d9eb67d751272556c14646003c8a27c7b0'
AND (
token = '/A3wX14Nn3Ls0wJy+pxvDHB5XFYbB07xYZRLlLksEKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)