UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dOE4df9UVeBQfNKLJXG0h0F+L5DVBVSClJAC5LMthm8='
WHERE
key_id = '8227c22f2597d6e120306e393a46217522c49e8ff8333fce1ba9ebc9759adaac'
AND (
token = 'dOE4df9UVeBQfNKLJXG0h0F+L5DVBVSClJAC5LMthm8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)