UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1qULA6H0Yn+4oamBUPiQUjkH0mSZGP8rLCwJpSvuAeQ='
WHERE
key_id = '3ba0d404de688d715ec17551fb4b086a7707c8dfc7862ae9877e31ea263805f4'
AND (
token = '1qULA6H0Yn+4oamBUPiQUjkH0mSZGP8rLCwJpSvuAeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)