UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RP4F/ahzFHn8FSW9HAlmuq5jiEgw3xUzjBZJ9yL20Vs='
WHERE
key_id = '11cff1a5711153aaf56cb2fd471da220786c9252f023b1dbd0001e555bd08f41'
AND (
token = 'RP4F/ahzFHn8FSW9HAlmuq5jiEgw3xUzjBZJ9yL20Vs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)