UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p91fLTVp/PIn+ZrQ0qy2RfjseEWbZ1c5l9Ca2r+nf3o='
WHERE
key_id = '5204c3d4b51b0a376762bdd807cc7a0e55e2fc2dc6cb7adbee2b05166e0d4443'
AND (
token = 'p91fLTVp/PIn+ZrQ0qy2RfjseEWbZ1c5l9Ca2r+nf3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)